<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">

    <title>Bootstrap 4, from LayoutIt!</title>
    <style>
        #app{
            background-color: #d0d5d8;
        }
    </style>
</head>
<body>

<div  id="app">
    <div>
        <a v-bind:href="'questions.html?subjectId='+subjectId">所有题目</a>
        <a v-bind:href="'newExam.html?subjectId='+subjectId">随机生成试卷</a>
    </div>
    <br><hr>
    <h4 v-if="results.length!=0">所有标签:</h4>
    <div v-for="tags in results">
        <a v-bind:href="'newExam.html?subjectId='+subjectId+'&tagsId='+tags.tagsId">{{tags.tagsName}}</a>
    </div>

</div>

<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/vue.min.js"></script>
<script type="text/javascript">
    new Vue({
        el:"#app",
        data:{
            subjectId:0,
            results:{}
        },
        mounted:function () {
            let that=this
            that.subjectId=$.getUrlParam("subjectId")
            $.ajax({
                type:"GET",
                url:"/question/search/tags?id="+that.subjectId,
                success:function (results) {
                    that.results=results.data
                    console.log(that.results)
                }
            })
        }
    })
</script>

</body>
</html>